<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class Test extends Controller {

    public function testMenuGet() {
        $this->loadModel('WechatSdk');

        $st = WechatSdk::getServiceAccessToken();
        $menu = WechatSdk::getMenu($st);

        var_dump($menu);
    }

    public function testMenuSet() {
        $this->loadModel('WechatSdk');

        $menu = file_get_contents(dirname(__FILE__) . '/../config/wechat_menu.json');
        
        echo $menu;
       
        $st = WechatSdk::getServiceAccessToken();
        $rst = WechatSdk::setMenu($st, $menu);

        var_dump($rst);
    }

}
